<?php

namespace easydis\APSBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Heures
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="easydis\APSBundle\EntityRepository\HeuresRepository")
 */
class Heures
{
    /**
     * @var string
     *
     * @ORM\Column(name="date", type="string", length=30)
     * @ORM\Id
     */
    private $date;

    /**
     * @var date
     *
     * @ORM\Column(name="date_eng", type="date")
     */
    private $date_eng;
    
    /**
     * @var float
     *
     * @ORM\Column(name="hprev", type="float")
     */
    private $hprev;

    /**
     * @var float
     *
     * @ORM\Column(name="hobj", type="float")
     */
    private $hobj;

    /**
     * @var float
     *
     * @ORM\Column(name="hreel", type="float")
     */
    private $hreel;

    /**
     * @ORM\ManyToOne(targetEntity="easydis\APSBundle\Entity\Section")
     * @ORM\JoinColumn(nullable=false)
     * @ORM\Id
     */
    private $section;
    
    
    public function __construct($date, $sc) {
        $this->date = $date;
        $this->section = $sc;
        $this->hprev = 0;
        $this->hobj = 0;
        $this->hreel = 0;

        $this->date_eng = date_create_from_format('d/m/Y', $date);
    }   

    /**
      * Set section
      *
      * @param easydis\APSBundle\Entity\Section $section
      */
    public function setSection(\easydis\APSBundle\Entity\Section $section)
    {
            $this->section = $section;
    }

    /**
      * Get section
      *
      * @return easydis\APSBundle\Entity\Section 
      */
    public function getSection()
    {
            return $this->section;
    }
	
    /**
     * Get date
     *
     * @return string 
     */
    public function getDate()
    {
        return $this->date;
    }

    /**
     * Get date_eng
     *
     * @return date
     */
    public function getDate_eng()
    {
        return $this->date_eng;
    }
    
    /**
     * Set hprev
     *
     * @param float $hprev
     * @return Heures
     */
    public function setHprev($hprev)
    {
        $this->hprev = $hprev;
    
        return $this;
    }

    /**
     * Get hprev
     *
     * @return float 
     */
    public function getHprev()
    {
        return $this->hprev;
    }

    /**
     * Set hobj
     *
     * @param float $hobj
     * @return Heures
     */
    public function setHobj($hobj)
    {
        $this->hobj = $hobj;
    
        return $this;
    }

    /**
     * Get hobj
     *
     * @return float 
     */
    public function getHobj()
    {
        return $this->hobj;
    }

    /**
     * Set hreel
     *
     * @param float $hreel
     * @return Heures
     */
    public function setHreel($hreel)
    {
        $this->hreel = $hreel;
    
        return $this;
    }

    /**
     * Get hreel
     *
     * @return float 
     */
    public function getHreel()
    {
        return $this->hreel;
    }
}
